﻿using AutoMapper;
using ERP.Domain.System;
using System.Api.Write.Applications.Commands.Permissions;
using System.Api.Write.Applications.Commands.Roles;
using System.Api.Write.Applications.Commands.Users;
using System.Api.Write.Applocations.Commands.Organizes;
using System.Api.Write.Applocations.Commands.Posts;

namespace System.Api.Write.Tools
{
    /// <summary>
    /// 映射配置
    /// </summary>
    public class MyAutoMapper : Profile
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public MyAutoMapper()
        {
            CreateMap<Organize,OrganizeCreateCommand>().ReverseMap();
            CreateMap<Organize,OrganizeUpdateCommand>().ReverseMap();
            CreateMap<Post, PostCreateCommand>().ReverseMap();
            CreateMap<Post, PostUpdateCommand>().ReverseMap();
            CreateMap<User, UserCreateCommand>().ReverseMap();
            CreateMap<User, UserUpdateCommand>().ReverseMap();
            CreateMap<Role, RoleCreateCommand>().ReverseMap();
            CreateMap<Role, RoleUpdateCommand>().ReverseMap();
            CreateMap<Permission, PermissionCreateCommand>().ReverseMap();
            CreateMap<Permission, PermissionUpdateCommand>().ReverseMap();
        }
    }
}
